#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/CubemapTexture.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"
#include "Render/Buffer/VertexBuffer.h"
#include "Render/Buffer/IndexBuffer.h"

class LocalScene;

class LowpolyProcess : public RenderProcess
{
	DECLARE_PROCESS(LowpolyProcess)

	struct Ubo
	{
		glm::mat4 proj;
		glm::mat4 view;
		glm::mat4 model;
		glm::vec3 scale;
	};

	struct LocalVertex
	{
		glm::vec3 position;
		glm::vec3 normal;
	};


protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	LocalScene* mLocalScene;

	RefCountPtr<RHIBuffer> mUboBuffer;

	RefCountPtr<VertexBuffer> mVertexBuffer;

	RefCountPtr<VertexBuffer> mInstanceBuffer;

	uint32 mInstanceSize;

	RefCountPtr<IndexBuffer> mIndexBuffer;

	RefCountPtr<RHIDescriptor> mDescriptor;

	DescriptorMask mDescriptorMask;

	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;

	RefCountPtr<ColorRenderTarget> mColorRenderTarget;

	RefCountPtr<DepthRenderTarget> mDepthRenderTarget;
};
